<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>${title }</title>
    <link rel="stylesheet" href="${basePath}/static/bootstrap/css/bootstrap.css"/>
    <link href="${basePath}/static/css/basic.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/login.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/list.css" rel="stylesheet" type="text/css">
<%--     <link rel="stylesheet" href="${basePath}/static/css/content_leftNav.css"/>
    <link rel="stylesheet" href="${basePath}/static/css/FrontControl.css"/> --%>
    <script  type="text/javascript" src="${basePath}/static/js/jquery.min.js"></script>
	<script  type="text/javascript" src="${basePath}/static/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="${basePath}/static/page/jqPaginator/jqPaginator.js"></script>
    <script  type="text/javascript" src="${basePath}/static/layer/layer.js"></script>
    <link href="${basePath}/static/layer/layer_defined.css" rel="stylesheet" type="text/css">
    
</head>
<body>
<!--头部-->
	<%@include file="/WEB-INF/templates/common/header.jsp"%>
	<!------导航条-->
	<%@include file="/WEB-INF/templates/common/navigation.jsp"%>

<!--内容部分-->
<div class="list_main lay_out" class="clearfix">
    <div class="list_DH">
        <%@include file="/WEB-INF/templates/common/inhospitalDisease.jsp"%>
    </div>
    <div class="list_NR">
        <div class="loc">
            <h3 style="margin:0">编目质控</h3>
        </div>
        <div class="list_con_table">
            <div class="search_table">
                <ul class="clearfix" style="margin-bottom:0;">
                	<li class="Label_1" >出院日期：&nbsp;</li>
                    <li class="Label_4" style="text-align:left;padding-left:3px;width:35%">
                    	<input class="input_box" style="width:45%;" type="text"  name='startTime' id='outHospitalStartDate' value='' onFocus="WdatePicker()" />
                    	<span>&nbsp;-&nbsp;</span>
                    	<input class="input_box" type="text" style="width:45%;"  name='endTime' id='outHospitalEndDate' value='' onFocus="WdatePicker()" />
                    </li>
                    <li class="Label_5">
                        <div class="right" style="text-align:right">
                            <a onclick="searchQua()">查询</a>
                         	
                        </div>
                    </li>
                  
                </ul>
            </div> 
             <table class="Search_tableList" cellpadding="0" cellspacing="0">
                <tr style="height:20px">
             
                    <td class="tdLabel_4" rowspan="2">人员</td>
                    <td class="tdLabel_4" style="width:20%" rowspan="2">应编病案数</td>
                    <td class="tdLabel_4" style="width:20%" colspan="2">实编病案</td>
                    <td class="tdLabel_4" style="width:45%" colspan="3">编码质量</td>
                </tr>
              <tr>
                    <td class="tdLabel_4" style="width:10%">完成数</td>
                    <td class="tdLabel_4" style="width:10%"> 完成率</td>
                    <td class="tdLabel_4" style="width:15%">一般项目错误</td>
                    <td class="tdLabel_4" style="width:15%">重要项目错误</td>
                    <td class="tdLabel_4" style="width:15%">错误显示</td>
                </tr>
                
                <tbody id="tbody">
                 <tr>
                    <td class="tdLabel_5">李宁</td>
                    <td class="tdLabel_5">1693</td>
                    <td class="tdLabel_5">522</td>
                    <td class="tdLabel_5">30.83%</td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
               
                </tr>
                <tr>
                    <td class="tdLabel_5">李启龙</td>
                    <td class="tdLabel_5">1584</td>
                    <td class="tdLabel_5">1144</td>
                    <td class="tdLabel_5">72.22%</td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
                  
                </tr>
                <tr>
                    <td class="tdLabel_5">李玉玲</td>
                    <td class="tdLabel_5">2448</td>
                    <td class="tdLabel_5">989</td>
                    <td class="tdLabel_5">40.0%</td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
                    
                </tr>
                <tr>
                    <td class="tdLabel_5">刘玉</td>
                    <td class="tdLabel_5">1880</td>
                    <td class="tdLabel_5">1374</td>
                    <td class="tdLabel_5">73.09%</td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
                  
                </tr>
                <tr>
                    <td class="tdLabel_5">王悦</td>
                    <td class="tdLabel_5">1839</td>
                    <td class="tdLabel_5">493</td>
                    <td class="tdLabel_5">26.81%</td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
                    
                </tr>
                <tr>
                    <td class="tdLabel_5">徐建乐</td>
                    <td class="tdLabel_5">1341</td>
                    <td class="tdLabel_5">347</td>
                    <td class="tdLabel_5">25.88%</td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
                    
                </tr>
                <tr>
                    <td class="tdLabel_5">徐珊珊</td>
                    <td class="tdLabel_5">1019</td>
                    <td class="tdLabel_5">234</td>
                    <td class="tdLabel_5">22.96%</td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
                    <td class="tdLabel_5"></td>
                    
                </tr>
                
                </tbody>
            </table>
        </div>
        
        <!--
        	    <div class="pageList">
		            <ul class="pagination clearfix" id="page_plus"></ul>
		            <div class="pagination">
		                <div>总共：<b id="totalPage">0</b> 条信息    当前页是第 <b id="currentPage">0/0</b>　页</div>
		            </div>
        		</div>
         -->
    </div>
</div>
<!------页脚部分--------->
<%@include file="/WEB-INF/templates/common/footer.jsp"%>

<!--JS部分-->
<script type="text/javascript">

	$(function(){
		$("#tbody").hide();
	});
	
	
	function searchQua(){
		$("#tbody").show();
		//queryQua(0,20);
	}

	function queryQua(currentStartNum,pageSize){
		
		var name=$("#name").val();
		var idCard=$("#idCard").val();
		var outHospitalStartDate=$("#outHospitalStartDate").val();
		var outHospitalEndDate=$("#outHospitalEndDate").val();
		
		if((outHospitalStartDate==null || outHospitalStartDate=="") && (outHospitalEndDate==null || outHospitalEndDate=='') && (name==null || name=='') && (idCard==null || idCard=='')){
			layer.alert("请输入查询条件!",{icon:7});
			return;
		}
		

		
		
		jQuery.support.cors = true;
		$.ajax({
			type:"get",
			url:"http://localhost:8888/medical-manage/statis/queryMedrecordByAjax",
			data:{idCard:idCard,outHospitalStartDate:outHospitalStartDate,outHospitalEndDate:outHospitalEndDate,name:name,currentStartNum:currentStartNum,pageSize:pageSize},
			success:function(data){
				$("#tbody").html("");
				
				if(data.success){
					var hospitalizationNotes=data.data.hospitalizationNotes;
					var medRecordQuery=data.data.medRecordQuery;
					alert(medRecordQuery);
					var totalCounts=medRecordQuery.totalCounts;
					var html="";
					for(var i=0;i<hospitalizationNotes.length;i++){
						var hospitalizationNote=hospitalizationNotes[i];
						html+=" <tr>"+
				              "      <td class='tdLabel_5'>"+hospitalizationNote.mr_id+"</td>"+
				              "      <td class='tdLabel_5'>"+hospitalizationNote.name+"</td>"+
				              "      <td class='tdLabel_5'>"+hospitalizationNote.id_number+"</td>"+
				              "      <td class='tdLabel_5'>"+hospitalizationNote.out_hospital_date+"</td>"+
				              "      <td class='tdLabel_5' style='width:280px'><a class='btn' style='padding:6px 2px' target='_blank' href='${basePath}/statics/showMedrecordImage?firstGuid="+hospitalizationNote.first_level_medical_guid+"'>首页预览</a> <a class='btn' target='_blank' href='http://localhost:8888/medical-manage/medrecord/medrecordHomePageManage?firstGuid="+hospitalizationNote.first_level_medical_guid+"'>首页编辑</a></td>"+
				              "  </tr>";
					}
					
					$("#tbody").html(html);
					page(currentStartNum+1,totalCounts);
					
				}
	
			}
		})
		
	}
	
	 function page(currentPage,totalCounts){
		 alert(currentPage+"--"+totalCounts);
	    	//var totalCounts = 1000;
	        var pageSize = 20;
	        var visiblePages = 10;
	        //var currentPage = 1;
	        /* var totalPages = totalCounts%pageSize==0?(totalCounts/pageSize):(totalCounts/pageSize+1); */
	        var totalPages = Math.ceil(totalCounts/pageSize);
	        $('#page_plus').jqPaginator({

	            totalCounts: totalCounts,
	            pageSize:pageSize,
	            visiblePages: visiblePages,
	            currentPage: currentPage,

	            first:'<li class="first"><a href="javascript:void(0);">首页</a></li>',
	            prev: '<li class="prev"><a href="javascript:void(0);">上一页</a></li>',
	            next: '<li class="next"><a href="javascript:void(0);">下一页</a></li>',
	            last: '<li class="last"><a href="javascript:void(0);">末页</a></li>',
	            page: '<li class="page"><a href="javascript:void(0);">{{page}}</a></li>',
	            onPageChange: function (num,type) {
	          
	            	 if(type !='init'){
	                 
	            		 queryQua(num-1,pageSize);
	                 }
	            	
	                $("#totalPage").html(totalCounts);
	                $("#currentPage").html(num+"/"+totalPages);
	            }
	        });

	    }
	 
	
</script>

</body>
</html>